Skip to content

refactor(agent): the grounding harness is imported, not mirrored - #448

Merged
catomean merged 1 commit into
mainfrom
refactor/import-grounding-from-ai-kit
Aug 31, 2026
Merged

refactor(agent): the grounding harness is imported, not mirrored#448
catomean merged 1 commit into
mainfrom
refactor/import-grounding-from-ai-kit

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

FleetCrown half of the mirror retirement (fleet AI-engine plan, Phase 2). src/lib/agent/core was the CANONICAL copy of the grounding harness, mirrored byte-for-byte into OrangeCat and policed by scripts/test/agent-core-drift.ts plus scripts/sync-agent-core.ts. Its own README called the duplication "deliberate and temporary" and named extraction to a package as the exit. ai-kit v0.6.2 is that exit; OrangeCat's twin PR (bitbaum/orangecat#846) is already merged and deployed.

What changes

  • Fourteen imports across nine files collapse from three deep paths (@/lib/agent/core/{facts,contract,verify}) to one subpath import: ai-kit/grounding.
  • src/lib/agent/core/, scripts/sync-agent-core.ts, scripts/test/agent-core-drift.ts, and the sync:agent-core npm script are deleted, not kept green: with a single copy there is nothing left to drift, and a gate with no possible failure mode is noise wearing a uniform.
  • ai-kit moves v0.2.1 → v0.6.2 (the old lock entry still carried the ai-ration name). The three root imports this repo uses (chain, fair-share, limits) are unchanged surfaces across that jump — typecheck confirms.

Fidelity of the packaged copy
The packaged harness differs from the deleted canonical by two mechanical deltas, both made where the code now lives: .js extensions on relative imports (pure ESM) and two null-guards under ai-kit's noUncheckedIndexedAccess. Behavior is covered by ai-kit's own grounding tests plus the dual-loader test (both mutation-proved).

Verification
tsc clean; 124/124 unit test files pass (one fewer file than before: the drift check no longer exists to run).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

FleetCrown half of the mirror retirement (fleet AI-engine plan, Phase 2).
src/lib/agent/core was the CANONICAL copy of the harness, mirrored
byte-for-byte into OrangeCat and policed by scripts/test/agent-core-drift.ts
plus scripts/sync-agent-core.ts. Its own README called the duplication
"deliberate and temporary" and named extraction to a package as the exit.
ai-kit v0.6.2 is that exit; OrangeCat's twin PR (#846, merged) deletes the
other side.

Fourteen imports across nine files collapse from three deep paths to one
subpath import. The sync script, the drift check and the npm script that ran
it are deleted rather than kept green: with a single copy there is nothing
left to drift, and a gate with no possible failure mode is noise wearing a
uniform. ai-kit also moves v0.2.1 -> v0.6.2 (still the ai-ration name in the
old lock entry); the three root imports this repo uses (chain, fair-share,
limits) are unchanged surfaces across that jump, which typecheck confirms.

The packaged copy differs from the deleted canonical by two mechanical
deltas, both made where the code now lives: .js extensions on relative
imports (pure ESM) and two null-guards under ai-kit's
noUncheckedIndexedAccess.

tsc clean; 124/124 unit test files pass (one fewer than before: the drift
check no longer exists to run).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
@catomean
catomean merged commit bc0493f into main Aug 31, 2026
3 checks passed
@catomean
catomean deleted the refactor/import-grounding-from-ai-kit branch August 31, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant